<?php 

move_direction("D:/test/","E:/test1/");

function move_direction(oldfile,newfile){

	// function RecursiveCopy($source, $dest, $diffDir = ''){
    $sourceHandle = opendir($source);
    if(!$diffDir)
            $diffDir = $source;
   
    mkdir($dest . '/' . $diffDir);
   
    while($res = readdir($sourceHandle)){
        if($res == '.' || $res == '..')
            continue;
       
        if(is_dir($source . '/' . $res)){
            RecursiveCopy($source . '/' . $res, $dest, $diffDir . '/' . $res);
        } else {
            copy($source . '/' . $res, $dest . '/' . $diffDir . '/' . $res);
           
        }
    }
// } 


}





 ?>